home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Discovering Windows 98
/
WinExpert9.iso
/
features
/
VisualBasic
/
Vb01
/
State at end of previous tutorial
/
frmUnits.frm
(
.txt
)
next >
Wrap
Visual Basic Form
|
1997-10-19
|
2KB
|
75 lines
VERSION 5.00
Begin VB.Form frmUnits
Caption = "Units Conversion"
ClientHeight = 855
ClientLeft = 60
ClientTop = 345
ClientWidth = 3615
LinkTopic = "Form1"
ScaleHeight = 855
ScaleWidth = 3615
StartUpPosition = 3 'Windows Default
Begin VB.CommandButton cmdConvert
Caption = "Convert"
Enabled = 0 'False
Height = 375
Left = 2400
TabIndex = 4
Top = 240
Width = 975
End
Begin VB.TextBox txtCM
Enabled = 0 'False
Height = 285
Left = 1080
TabIndex = 1
Top = 480
Width = 855
End
Begin VB.TextBox txtInches
Height = 285
Left = 1080
TabIndex = 0
Top = 120
Width = 855
End
Begin VB.Label Label2
Caption = "Centimetres"
Height = 255
Left = 120
TabIndex = 3
Top = 480
Width = 975
End
Begin VB.Label Label1
Caption = "Inches"
Height = 255
Left = 120
TabIndex = 2
Top = 120
Width = 735
End
Attribute VB_Name = "frmUnits"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdConvert_Click()
txtCM.Text = txtInches.Text * 2.52
End Sub
Private Sub txtInches_Change()
If txtInches.Text = "" Then
cmdConvert.Enabled = False
Else
cmdConvert.Enabled = True
End If
End Sub
Private Sub txtInches_KeyPress(KeyAscii As Integer)
If Not IsNumeric(Chr(KeyAscii)) Then
If KeyAscii <> 8 Then
KeyAscii = 0
Beep
End If
End If
End Sub